#pragma once
#ifndef __PROPERTYMANAGER_HEADER__
#define __PROPERTYMANAGER_HEADER__

#include "Common.hpp"
#include <AntTweakBar.h>
#include "ISingleton.hpp"
#include <TwOgreBoolVariable.h>
#include <TwOgreRealVariable.h>
#include <TwOgreIntegerVariable.h>

//////////////////////////////////////////////////////////////////////////

#define PM PropertyManager::Get()

class PropertyManager : public ISingleton<PropertyManager>
{
public:
	PropertyManager();
	~PropertyManager();

	void load(std::istream& stream);
	void save(std::ostream& stream) const;

	TwOgre::BoolVariable* paused;

	TwOgre::IntegerVariable* numFish;
	TwOgre::IntegerVariable* numPredator;

	TwOgre::RealVariable* forceScale;
	TwOgre::RealVariable* damping;
	TwOgre::RealVariable* zeroVelocity;

	struct {
		TwOgre::RealVariable* mass;
		TwOgre::RealVariable* radius;
		TwOgre::RealVariable* maxVelocity;
		TwOgre::RealVariable* turnRate;

		struct {
			TwOgre::RealVariable* wander;
			TwOgre::RealVariable* separation;
			TwOgre::RealVariable* alignment;
			TwOgre::RealVariable* cohesion;
			TwOgre::RealVariable* evade;
		} weights;

		struct {
			TwOgre::RealVariable* jitter;
			TwOgre::RealVariable* distance;
			TwOgre::RealVariable* radius;
		} wander;

		struct {
			TwOgre::RealVariable* neighborRadius;
		} flocking;

		struct {
			TwOgre::RealVariable* radius;
		} separation;

		struct {
			TwOgre::RealVariable* dangerRadius;
			TwOgre::RealVariable* turnAround;
			TwOgre::RealVariable* timeScale;
		} evade;

	} fish;

	struct {
		TwOgre::RealVariable* mass;
		TwOgre::RealVariable* radius;
		TwOgre::RealVariable* maxVelocity;
		TwOgre::RealVariable* turnRate;

		struct {
			TwOgre::RealVariable* jitter;
			TwOgre::RealVariable* distance;
			TwOgre::RealVariable* radius;
		} wander;

		struct {
			TwOgre::RealVariable* attackRadius;
			TwOgre::RealVariable* timeScale;
		} pursuit;

	} predator;

	struct {
		TwOgre::RealVariable* mass;
		TwOgre::RealVariable* radius;
		TwOgre::RealVariable* maxVelocity;
		TwOgre::RealVariable* turnRate;

		struct {
			TwOgre::RealVariable* separation;
			TwOgre::RealVariable* evasion;
		} ranges;

	} diver;
};

//////////////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////

#endif // #ifndef __PROPERTYMANAGER_HEADER__